home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmMain
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "foo"
- ClientHeight = 2925
- ClientLeft = 3090
- ClientTop = 3585
- ClientWidth = 6255
- ClipControls = 0 'False
- Height = 3300
- Left = 3045
- LinkTopic = "Form1"
- MinButton = 0 'False
- ScaleHeight = 2925
- ScaleWidth = 6255
- Top = 3255
- Width = 6345
- Begin CommandButton cmdExit
- Caption = "Exit"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 330
- Left = 5040
- TabIndex = 5
- Top = 120
- Width = 1095
- End
- Begin Frame Frame1
- BackColor = &H00C0C0C0&
- Caption = "Infomation"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1935
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 4815
- Begin Label lblCompany
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 480
- TabIndex = 0
- Top = 1560
- Width = 3855
- End
- Begin Label lblName
- BackStyle = 0 'Transparent
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 480
- TabIndex = 1
- Top = 720
- Width = 3975
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Name"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 240
- TabIndex = 2
- Top = 360
- Width = 420
- End
- Begin Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Company"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 240
- TabIndex = 3
- Top = 1200
- Width = 660
- End
- End
- Begin Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Today's Date:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 240
- TabIndex = 9
- Top = 2160
- Width = 990
- End
- Begin Label lblExpiresDate
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "1-3-95"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 1440
- TabIndex = 6
- Top = 2400
- Width = 450
- End
- Begin Label Label4
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "Expires on:"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 240
- TabIndex = 7
- Top = 2400
- Width = 780
- End
- Begin Label lblTodayDate
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "1-1-96"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 195
- Left = 1440
- TabIndex = 8
- Top = 2160
- Width = 450
- End
- Option Explicit
- Sub cmdExit_Click ()
- End
- End Sub
- Sub Form_Load ()
- 'center the window
- CenterPopUpWindow Me
- 'display today date
- lblTodayDate.Caption = Format(Now, "m-d-yy")
- Show
- Refresh
- Initialize
- End Sub
- Sub Initialize ()
- Dim wSealLen%
- Dim wErr%
- 'initialize the gApplicationInfo type
- gApplicationInfo.bOverWriteSeal = False ' this field is ignored when reading the buffer
- gApplicationInfo.szMagicString = "magicstring" & Chr$(0) ' the magic string which in this case is 'magicstring'
- gApplicationInfo.szAppName = CurDir$ & "\" & App.EXEName & ".EXE" & Chr$(0) ' the exename with a null chr$(0)
- wSealLen% = Len(gfoo)
- wErr% = ValidateApplication(gApplicationInfo, wSealLen%, gfoo)
- If wErr% <> 0 Then
- 'Stop, an error
- Dim szErrorString As String * 250
- GetSealError wErr%, szErrorString
- MsgBox szErrorString
- Else
- 'HighLight bFirstTime and press Shift-F9.
- 'You will be able to see the value..
- If gfoo.bFirstTime = True Then
- frmRegister.Show 1
- End If
- Dim wMonth%, wDay%, wYear%
- wErr% = ConvertDateFromLong(gfoo.dtExpirationDate, wMonth%, wDay%, wYear%)
- If wErr% <> 0 Then
- 'this should never happen!
- End If
- If IsExpired(wMonth%, wDay%, wYear%) = False Then
- lblCompany.Caption = strip_nulls(gfoo.szCompany)
- lblName.Caption = strip_nulls(gfoo.szName)
- lblExpiresDate.Caption = Format(wMonth% & "-" & wDay% & "-" & wYear%, "m-d-yy")
- Else
- MsgBox "foo had expired.", MB_ICONSTOP, "foo"
- End
- End If
- End If
- End Sub
- Function IsExpired (wExMonth%, wExDay%, wExYear%)
- Dim dtCurrent&, dtExpired&
- dtCurrent& = Now
- dtExpired& = DateValue(wExMonth% & "-" & wExDay% & "-" & wExYear%)
- If dtCurrent& > dtExpired& Then
- IsExpired = True
- Else
- IsExpired = False
- End If
-
- End Function
-